package com.elontian.util;

import java.util.Date;
import java.util.List;

import android.graphics.Bitmap;

import com.elontian.db.data.modle.URLData;

public class CheckUtil {
	public static boolean isNull(Object str) {
		return str == null;
	}

	public static boolean isNullString(String str) {
		return (str == null || "".equals(str));
	}

	public static boolean isNotNullString(String str) {
		return (str != null && !"".equals(str));
	}

	public static boolean isEqualString(String one, String anther) {
		return (one != null && anther != null && one.equals(anther));
	}

	/**
	 * 判断图片是否为空
	 * 
	 * @param bitmap
	 * @return
	 */
	public static final boolean isNotNullBitmap(Bitmap bitmap) {
		return (bitmap != null && !bitmap.isRecycled());
	}

	public static final boolean isNotNullList(List list) {
		return (list != null && list.size() != 0);
	}

	public static int DATA_DIE_TIME = 12 * 60 * 60 * 1000;

	public static boolean checkDieData(URLData urldata) {
		// TODO Auto-generated method stub
		long now = new Date().getTime();
		if (now - urldata.getTime() > DATA_DIE_TIME) {
			return false;
		} else {
			return true;
		}

	}
}
